home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nftroff.zip / 6.tr < prev    next >
Text File  |  1991-11-21  |  16KB  |  958 lines

  1. .de }n
  2. .bp
  3. .sp .5i
  4. ..
  5. .wh -.8i }n
  6. .sp .5i
  7. .po -.4i
  8. .ll 7.5i
  9. .ps 9
  10. .vs 9
  11. .in 0i
  12. .ta 1.63265i
  13. .sp 2
  14. .ne 20
  15. .ps +3
  16. .vs +3
  17. FT_COM3OR4()    Enable use of COM3 and/or COM4 on IBM/PC compatables\.
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_COM3OR4()
  25. Enable use of COM3 and/or COM4 on IBM/PC compatables\.
  26. .in 0i
  27. .br
  28. \l'6.24i'
  29. .br
  30. .sp
  31. .in 0.08i
  32. \fBSyntax
  33. .sp
  34. .in 0.4i
  35. \fBFT_COM3OR4( <nPort> ) -> lSuccess
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. \fB<nPort>\fR is the COM port to enable\.  Ports except 3 and 4 are ignored\.
  42. The default is 3\.
  43. .sp
  44. .in 0.08i
  45. \fBReturns
  46. .sp
  47. .in 0.4i
  48. a logical indicating success or failure of the operation\.
  49. .sp
  50. .in 0.08i
  51. \fBDescription
  52. .sp
  53. .in 0.4i
  54. FT_COM3OR4() uses FT_POKE() to write to memory the correct data
  55. to enable COM3 or COM4 on IBM-PC compatables\.  The programmer will
  56. still need to explicitly open the port with SET PRINTER or FOPEN()
  57. to send data out the port\.
  58. .sp
  59. FT_COM3OR4() owes everything to FT_POKE()\.
  60. .sp
  61. .in 0.08i
  62. \fBExamples
  63. .sp
  64. .in 0.4i
  65. .br
  66. // attempt to enable COM3
  67. .br
  68. IF FT_COM3OR4( 3 )
  69. .in 0.64i
  70. .br
  71. Qout("COM3 was enabled")
  72. .in 0.4i
  73. .br
  74. END
  75. .sp
  76. .sp
  77. .in 0.08i
  78. \fBSource:\fR COM34\.PRG
  79. .sp
  80. \fBAuthor:\fR Steve Kolterman
  81. .in 0i
  82. .ta 1.63265i
  83. .sp 2
  84. .ne 20
  85. .ps +3
  86. .vs +3
  87. FT_DIR2DB()    Create \.DBF of directory files, using DOS filespec
  88. .br
  89. .ta
  90. .in 0.08i
  91. .ps -3
  92. .vs -3
  93. .sp 2
  94. \fBFT_DIR2DB()
  95. Create \.DBF of directory files, using DOS filespec
  96. .in 0i
  97. .br
  98. \l'6.24i'
  99. .br
  100. .sp
  101. .in 0.08i
  102. \fBSyntax
  103. .sp
  104. .in 0.4i
  105. \fBFT_DIR2DB( <cSpec> [, <cDbf> ][, <cNtx> ][, <cDrvr> ] ) -> <nErrcode>
  106. .sp
  107. .in 0.08i
  108. \fBArguments
  109. .sp
  110. .in 0.4i
  111. \fB<cSpec>\fR can be any valid DOS file spec\., including wildcards and
  112. .in 0.48i
  113. single file names\.
  114. .sp
  115. .in 0.4i
  116. \fB<cDbf>\fR is the name of the \.DBF to create\.  If not specified, the
  117. .in 0.48i
  118. name \'FILES\' is used\.
  119. .sp
  120. .in 0.4i
  121. \fB<cNtx>\fR is the name of the \.NTX to create\.  If not specified, no
  122. .in 0.48i
  123. index is created\.
  124. .sp
  125. .in 0.4i
  126. \fB<cDrvr>\fR is the name of the Nantucket RDD (replaceable database
  127. .in 0.48i
  128. driver) to use\.  If not specified, the default, \'DBFNTX\', is
  129. used\.
  130. .sp
  131. .in 0.08i
  132. \fBReturns
  133. .sp
  134. .in 0.4i
  135. <nErrcode>, which will be one of the following:
  136. .sp
  137. .in 0.64i
  138. .br
  139. 0 - no error
  140. .br
  141. 1 - no file spec\. passed
  142. .br
  143. 2 - no files match spec\. passed
  144. .br
  145. 3 - network error opening <cDbf>
  146. .sp
  147. .in 0.08i
  148. \fBDescription
  149. .sp
  150. .in 0.4i
  151. FT_DIR2DB() builds a \.DBF from and fills it with the files/data
  152. matching any valid DOS file spec\.  Fields created are \'Name\',
  153. \'Size\', \'Date\', \'Time\', and \'Attr\' (attribute)\.
  154. .sp
  155. An index on the \'name\' field is also created by passing a name
  156. for the \.NTX as a third parameter\.  An optional fourth parameter
  157. accommodates the RDDs (replaceable database drivers) Nantucket
  158. promises\.
  159. .sp
  160. .in 0.08i
  161. \fBExamples
  162. .sp
  163. .in 0.4i
  164. nVal:= FT_DIR2DB( "*\.dbf","dbffiles","filename" )
  165. Creates DBFFILES\.DBF consisting of all \.DBFs in the current dir-
  166. ectory, and also creates FILENAME\.NTX\.
  167. .sp
  168. nVal:= FT_DIR2DB( "*\.*","pdoxdbf","pdoxntx","paradox" )
  169. would create a Paradox database and index consisting of all files
  170. in the current directory\.
  171. .sp
  172. .in 0.08i
  173. \fBSource:\fR DIR2DBF\.PRG
  174. .sp
  175. \fBAuthor:\fR Steve Kolterman
  176. .in 0i
  177. .ta 1.63265i
  178. .sp 2
  179. .ne 20
  180. .ps +3
  181. .vs +3
  182. FT_EXIST()    Test for existence of drive and/or subdirectory
  183. .br
  184. .ta
  185. .in 0.08i
  186. .ps -3
  187. .vs -3
  188. .sp 2
  189. \fBFT_EXIST()
  190. Test for existence of drive and/or subdirectory
  191. .in 0i
  192. .br
  193. \l'6.24i'
  194. .br
  195. .sp
  196. .in 0.08i
  197. \fBSyntax
  198. .sp
  199. .in 0.4i
  200. \fBFT_EXIST( <cDriveDir> ) -> lResult
  201. .sp
  202. .in 0.08i
  203. \fBArguments
  204. .sp
  205. .in 0.4i
  206. \fB<cDriveDir>\fR is a character string containing drive spec (with colon)
  207. .in 0.64i
  208. or drive spec and path to and including subdirectory being
  209. tested for\.  Do not include backslash after subdirectory\.  If
  210. drive spec is not part of string, tests current drive\.
  211. .sp
  212. .in 0.08i
  213. \fBReturns
  214. .sp
  215. .in 0.4i
  216. .ta 0.88i
  217. <lResult>    as logical -
  218. .br
  219. .ta
  220. .in 0.64i
  221. .br
  222. \.T\. if drive exists, or subdirectory exists on specified drive
  223. .br
  224. \.F\. if drive or subdirectory does not exist
  225. .sp
  226. .in 0.08i
  227. \fBDescription
  228. .sp
  229. .sp
  230. .sp
  231. \fBExamples
  232. .sp
  233. .in 0.32i
  234. IF FT_EXIST( "D:" )
  235. .in 0.56i
  236. Qout("OK To Perform Operation On Drive D:")
  237. .in 0.32i
  238. ENDIF
  239. .sp
  240. .in 0.08i
  241. \fBSource:\fR EXIST\.PRG
  242. .sp
  243. \fBAuthor:\fR Steve Kolterman
  244. .in 0i
  245. .ta 1.63265i
  246. .sp 2
  247. .ne 20
  248. .ps +3
  249. .vs +3
  250. FT_GETE()    Return the entire current environment
  251. .br
  252. .ta
  253. .in 0.08i
  254. .ps -3
  255. .vs -3
  256. .sp 2
  257. \fBFT_GETE()
  258. Return the entire current environment
  259. .in 0i
  260. .br
  261. \l'6.24i'
  262. .br
  263. .sp
  264. .in 0.08i
  265. \fBSyntax
  266. .sp
  267. .in 0.4i
  268. \fBFT_GETE( [ @<xReceiveVar> ] ) -> nNumStrings
  269. .sp
  270. .in 0.08i
  271. \fBArguments
  272. .sp
  273. .in 0.4i
  274. \fB<xReceiveVar>\fR is the variable to receive the environment data\.
  275. .sp
  276. \fB<xReceiveVar>\fR can be a character type variable, in which case
  277. the function will place all environment strings in the variable
  278. separated by carriage return/line feeds (chr 13 + chr(10))\.
  279. .sp
  280. \fB<xReceiveVar>\fR can be an array type, in which case the function
  281. will place each string in an array element\.  The array MUST be
  282. declared with the proper number of elements prior to passing it
  283. to the function\.  This can be done by calling FT_GETE() without
  284. parameters first to get the number of strings in the environment\.
  285. .sp
  286. Note that the argument MUST be passed by reference\. Since arrays
  287. are by nature passed by reference, the "@" symbol is optional when
  288. passing an array\.
  289. .sp
  290. If no argument is passed, FT_GETE() merely returns the number
  291. of strings in the environment\.
  292. .sp
  293. .in 0.08i
  294. \fBReturns
  295. .sp
  296. .in 0.4i
  297. FT_GETE() returns the total number of strings found in the
  298. current program\'s environment\.
  299. .sp
  300. .in 0.08i
  301. \fBDescription
  302. .sp
  303. .in 0.4i
  304. This function stores ALL of the current program\'s environment
  305. variables in either a block of text lines or in an array\.  It is
  306. useful for looking at the entire environment at once, or recording
  307. a snapshot of it to a file for later inspection, such as when a
  308. program error occurs\.  If the value of ONE SPECIFIC variable is
  309. desired, use Clipper\'s built-in GETE() function\.
  310. .sp
  311. This function uses the undocumented internal variable "_environ",
  312. as well as the functions _strcpy(), _strcat(), and _strlen() from
  313. CLIPPER\.LIB
  314. .sp
  315. .in 0.08i
  316. \fBExamples
  317. .sp
  318. .in 0.4i
  319. Get the environment in text form and browse it:
  320. .sp
  321. .in 0.64i
  322. .ta 0.96i
  323. .br
  324. cEnvBlock    := ""
  325. .br
  326. .ta
  327. .br
  328. nNumStrings := FT_GETE(@cEnvBlock)
  329. .ta 0.24i
  330. .br
  331. @    0, 0 to MAXROW() - 1, MAXCOL()
  332. .br
  333. .ta
  334. .ta 0.24i
  335. .br
  336. @    MAXROW(), 0 say \'Browse strings, press ESC to exit\.\.\.\'
  337. .br
  338. .ta
  339. .br
  340. MEMOWRIT(cEnvBlock, 1, 1, MAXROW() - 2,MAXCOL() - 1, \.F\.)
  341. .sp
  342. .in 0.4i
  343. Get the environment in text form and write it to a file:
  344. .sp
  345. .in 0.64i
  346. .br
  347. cEnvBlock := ""
  348. .br
  349. FT_GETE(@cEnvBlock)
  350. .br
  351. MEMOWRIT("ENVIRON\.TXT", cEnvBlock)
  352. .sp
  353. .in 0.4i
  354. Get the environment in Array form:
  355. .sp
  356. .in 0.64i
  357. .br
  358. aEnvArray := ARRAY(FT_GETE())
  359. .br
  360. FT_GETE(aEnvArray)
  361. .ta 1.68i
  362. .br
  363. ? aEnvArray[1]    // "COMSPEC=C:\\COMMAND\.COM"
  364. .br
  365. .ta
  366. .ta 1.68i
  367. .br
  368. ? aEnvArray[2]    // "PATH=C:\\;C:\\DOS;C:\\UTIL;C:\\CLIP50\\BIN"
  369. .br
  370. .ta
  371. .in 0.8i
  372. .br
  373. \.\.\. etc \.\.\.
  374. .sp
  375. .in 0.08i
  376. \fBSource:\fR GETENVRN\.C
  377. .sp
  378. \fBAuthor:\fR Rick Whitt
  379. .in 0i
  380. .ta 1.63265i
  381. .sp 2
  382. .ne 20
  383. .ps +3
  384. .vs +3
  385. FT_LINKED()    Determine if a function was linked in
  386. .br
  387. .ta
  388. .in 0.08i
  389. .ps -3
  390. .vs -3
  391. .sp 2
  392. \fBFT_LINKED()
  393. Determine if a function was linked in
  394. .in 0i
  395. .br
  396. \l'6.24i'
  397. .br
  398. .sp
  399. .in 0.08i
  400. \fBSyntax
  401. .sp
  402. .in 0.4i
  403. \fBFT_LINKED( <cString> ) -> lResult
  404. .sp
  405. .in 0.08i
  406. \fBArguments
  407. .sp
  408. .in 0.4i
  409. \fB<cString>\fR is a character string containing one or more function
  410. .in 1.2i
  411. calls
  412. .sp
  413. .in 0.08i
  414. \fBReturns
  415. .sp
  416. .in 0.4i
  417. \.T\. if all functions within the string are currently linked into
  418. the application, \.F\. if one or more aren\'t\.  See below for a
  419. definition of "function\."
  420. .sp
  421. .in 0.08i
  422. \fBDescription
  423. .sp
  424. .sp
  425. .in 0.4i
  426. This function would be used in data driven application to determine
  427. whether or not a macro compiled function was linked in\.
  428. .sp
  429. Several functions can be passed, and nested, in <cString>\.
  430. .sp
  431. Caveat: Some function calls are converted by the preprocessor
  432. into other function calls\. You cannot have these types of
  433. functions in a macro compiled string as they never exist at
  434. runtime\. FT_LINKED will correctly tell you that they are invalid\.
  435. .sp
  436. For instance: there is no function called SORT() in any of the
  437. Nantucket LIBraries, but i